<?php
namespace app\index\model;
use think\model;
class order extends Model
{
    public function searchCidAttr($q,$v,$d)
    {
        $q->where('status','=',"$v");
    }
    public function searchKeywordsAttr($q,$v,$d)
    {
        $q->where('aname','like',"%$v%");
    }
    public function searchTimeAttr($q,$v,$d)
    {
        $q->where('addtime','>= time',"$v");
    }
    public function searchTime1Attr($q,$v,$d)
    {
        $q->where('addtime','<= time',"$v");
    }
    public function searchPriceAttr($q,$v,$d)
    {
        $q->where('price','>=',"$v");
    }
    public function searchPrice1Attr($q,$v,$d)
    {
        $q->where('price','<=',"$v");
    }

    public static function order($where)
    {
        $order=order::alias('a')
            ->where($where)
            ->leftJoin('ecm_order_status b','a.status=b.status_id')
            ->paginate(
                [
                    'list_rows'=>2,
                    'query'=>$where

                ]
            );
        return $order;
    }
    public static function order1()
    {
        $order1=order::select();
        return $order1;
    }
}